﻿<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 
<script type="text/javascript" src="${ctx}/scripts/jquery-1.4.2.min.js"></script> 
<script type="text/javascript" src="${ctx}/scripts/jcarousellite.min.js"></script>
<script type="text/javascript" src="${ctx}/scripts/index.js"></script>
<title>北京车辆段</title>
<link href="${ctx}/css/index.css" rel="stylesheet" type="text/css" /> 
</head>  
<script type="text/javascript">
           
  		  var confirm_go;
  		  		
		  window.onbeforeunload = onbeforeunload_handler; 
		  window.onunload = onunload_handler; 
		  
		  function onbeforeunload_handler(){ 
		  
		  	var n = window.event.screenX - window.screenLeft;  
  		  	var b = n > document.documentElement.scrollWidth-20;  
  
          if(b && event.clientY < 0 || event.altKey){                       
                  var warning="确认退出?";   
                  confirm_go = true; 
			      return warning; 
			      
          }else if(event.clientY > document.body.clientHeight || event.altKey)  { //用户点击任务栏，右键关闭，是按alt+F4关闭    
       
                   var warning="确认退出?";    
                   confirm_go = true; 
			       return warning; 
      	  }  	  
			
   		}      
	     function onunload_handler(){ 
	       if( confirm_go ==true){
	          $.get("${ctx}/web/Web/webLogout.do?t="+Math.random(), {
                Action:"get",tt:"tt"}, function (data, textStatus){		 

             });		
          }
        } 
var array=new Array(); 
var indexB=0; //默认第一个显示的图片的索引
var showTimeB=5000; //显示时间（单位：毫秒）
var img_VanishTimeB=0; //逐渐显示的时间（单位：毫秒） 
 
var index=0; //默认第一个显示的图片的索引
var showTime=5000; //显示时间（单位：毫秒）
var img_VanishTime=0; //逐渐显示的时间（单位：毫秒）
		  
var t = n = count = 0;
$(function() {
 
	
    initData(); //初始菜单 标题 天气预报、安全天数等信息 
    initSafHb();//左侧图标
    initNews();   //初始新闻
    initVedio();  //初始视频
    initPhoto();  //初始摄影
    initNotice();    //公告
    initXW();    //初始行文系统
    
    photoAlbumn("photo-sub","photo","step-num");
	 
}); 
function showMsg(){    
     var userid='${sessionScope.userId}';
     
     $.get("${ctx}/msg/MsgRecive/getMsgCount.do?t="+Math.random(), {
                Action:"get",Name:userid}, function (data, textStatus){	
                
                if(data == null) {
                  return;
                }
              var objs = eval("["+data+"]");
              if(objs[0].msgCount	 ==0 || objs[0].msgCount == undefined){        
                   return;
              }             	                    
              document.getElementById('msg').innerHTML = '您有<a href="javascript:openMsgWin();">['+objs[0].msgCount+']</a>条未读的消息';  
                             
              
    });	
     
           
  }
  function openMsgWin(){        
           
            var url='${ctx}/msg/MsgRecive/list.do'; //要打开的窗口
			var winName="newWin"; //给打开的窗口命名
			 document.getElementById('msg').innerHTML ='&nbsp;&nbsp;';
			// screen.availWidth 获得屏幕宽度
			// screen.availHeight 获得屏幕高度
			// 居中的算法是：
			// 左右居中： (屏幕宽度-窗口宽度)/2
			// 上下居中： (屏幕高度-窗口高度)/2

			var awidth=screen.availWidth/6*5;   //窗口宽度,需要设置
			var aheight=screen.availHeight/5*4;   //窗口高度,需要设置 
			var atop=(screen.availHeight - aheight)/2;    //窗口顶部位置,一般不需要改
			var aleft=(screen.availWidth - awidth)/2; //窗口放中央,一般不需要改
			var param0="scrollbars=0,status=0,menubar=0,resizable=2,location=0"; //新窗口的参数
			//新窗口的左部位置，顶部位置，宽度，高度 
    		var params="top=" + atop + ",left=" + aleft + ",width=" + awidth + ",height=" + aheight + "," + param0 ;
			win=window.open(url,winName,params); //打开新窗口
			win.focus(); //新窗口获得焦点             
            }
            
 //菜单 
function menuFix() { 
 var sfEls = document.getElementById("nav").getElementsByTagName("li");
 for (var i=0; i<sfEls.length; i++) {
	  sfEls[i].onmouseover=function() {
	  var ul = this.getElementsByTagName("ul")[0];
		  if(ul){
		      ul.style.display = "block";
			  this.className+=(this.className.length>0? " ": "") + "sfhover";
		  }
	  }
	  sfEls[i].onmouseout=function() {
	  		var ul = this.getElementsByTagName("ul")[0];
		  if(ul){
		      ul.style.display = "none";
		  	   this.className+=(this.className.length>0? " ": "") + "sfhover";
		  }
	  } 
 } 
} 
 </script>
<script type=text/javascript>
function openpwd(){	          
	        var width = 300;
            var height =200;
            var url='${ctx}/web/Web/changePWD.do'; //要打开的窗口   
            var returnVal =  window.showModalDialog(url, window, "dialogWidth="+width+"px;dialogHeight="+height+"px;status:0;scroll:no");   
} 
 function search(){
	 document.form1.method = "post";
	 document.form1.action = "${ctx}/web/Web/listNews.do";
	 document.form1.submit();

} 
  function showAuto() {
   
            n = n >= (count - 1) ? 0 : n + 1;
            $("#flash_smallimg > li:eq(" + n + ")").trigger('mouseover');
        }
 </script>
 

<body>
<div class="box">
	<div class="top">
    	<div class="Tright">
	<a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://10.78.109.32/index.jsp')"						          href="#">设为首页</a> |     
	    <a href="#" onclick="javascript:window.external.AddFavorite('http://10.78.109.32/index.jsp','北京车辆段')" title="收藏本站到你的收藏夹">收藏本站</a>
		</div>
        您好，欢迎光临北京车辆段！
    </div> 
	 <div class="top_img">   	
		<div class="column">
         <div class="photo" id="photo">
          <ul class="clear" id="photo-sub" style="width:2944px;height:200px">
           <li><img src="${ctx}/images/web/qj3.jpg" /></li>
            <li><img src="${ctx}/images/web/qj1.jpg" /></li>
           <li><img src="${ctx}/images/web/qj.jpg" /></li>
           <li><img src="${ctx}/images/web/qj1.jpg" /></li>
          </ul>
         </div>
        </div>	
    </div>  
    <script type="text/javascript" src="${ctx}/scripts/lunbo.js"></script>
    <div class="logo_box">
    	<div class="logo"><a href="#"><img src="${ctx}/images/web/logo.jpg" /></a></div>
        <div id="logo_middle" class="logo_middle">
         
            
            <div class="clear"></div>
        </div>
        <div class="logo_tq">
        	 
            <div id="weather">
             
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="nav_box">
    	<ul id="nav">
          
		</ul>
    </div>
    <div class="login_box">
         
    	<div class="login">
        <form id="forms" action="${ctx}/web/Web/webLogin.do" method="post">
        
          <c:if test="${sessionScope.username==null||sessionScope.username==''}" >
            用户名：<input name="userName" type="text" class="shurubox" />
            密码：<input name="userPwd" type="password" class="shurubox" />
         
          <input type="button" onclick="login()" value="立即登录" class="liji" />
          </c:if>
           <c:if test="${sessionScope.username!=null&&sessionScope.username!=''}" >
                您好!&nbsp;${sessionScope.username} 
                 &nbsp;<a  href="${ctx}/web/Web/webLogout.do" style="color:#6c6c6c;cursor:pointer;"> [退出] </a>
				 <a href="javascript:openpwd();" style="color:#6c6c6c;cursor: pointer;"  >[修改密码] </a>
                </div>
        <div  class="login">
        <script type="text/javascript">
           showMsg();
           window.setInterval(showMsg,10000); 	
         </script>
         
				<marquee id="msg" onmouseover=this.stop() onmouseout=this.start() width="400" height="27px"				 scrollAmount=3 scrollDelay=30  style="padding-top:0px;">
    			
				</marquee>
       	
           </c:if>
          <c:if test="${requestScope.result!=null&&requestScope.result!=''}" >
			 <script type="text/javascript" >
			     alert('${requestScope.result}'); 
			 </script>
		 </c:if> 
      </form>	
          
        
      </div>
        <div class="login_search">
       <form name = "form1">
        	<input type="text" name="newskeyword" value="请输入搜索关键字" class="search_box"  onfocus="if(value =='请输入搜索关键字'){value =''}" onblur="if (value ==''){value='请输入搜索关键字'}"/><input type="button" class="search_but" value="" onclick = "javascript:search();"/>
      </form>
        </div>
        <div class="clear"></div>
    </div>
    <div class="content">
    	<div class="left">
        	<div class="left_nrbox">
            	<div class="left_nrbox_title">安全天数</div>
                <div class="left_nrbox_center" align="center">
					<div class="mbottom">
                    <span> <div id="safe1"  style="width:50px;"></div> </span>
                    <table id="safe1Table" width="93" border="0" style="background:url(${ctx}/images/web/time_bg.jpg) no-repeat; height:37px; text-align:center; float:left; vertical-align:middle;;font-size:19px;font-weight:bold"> 
                        
                    </table>
                    <span>天</span>
                    <div class="clear"></div>
                    </div>
                    <div class="mbottom">
                    <span> <div id="safe2"  style="width:50px;"></div> </span>
                    <table id="safe2Table" width="93" border="0" style="background:url(${ctx}/images/web/time_bg.jpg) no-repeat; height:37px; text-align:center; float:left; vertical-align:middle;font-size:19px;font-weight:bold"> 
                      
                    </table>
                    <span>天</span>
                    <div class="clear"></div>
                    </div>
                    <div class="mbottom">
                    <span> <div id="safe3" style="width:50px;"></div> </span>
                    <table id="safe3Table" width="93" border="0" style="background:url(${ctx}/images/web/time_bg.jpg) no-repeat; height:37px; text-align:center; float:left; vertical-align:middle;;font-size:19px;font-weight:bold"> 
                       
                    </table>
                    <span>天</span>
                    <div class="clear"></div>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="left_nrbox" style="height:310px;" >
			    
            	<div class="left_nrbox_title"  >未签收通报</div> 
                <div class="left_nrbox_center" >
              <MARQUEE id="newsList" onmouseover=this.stop() onmouseout=this.start() 
                  scrollAmount=1 scrollDelay=30 direction=up   	>
                  
                 </MARQUEE>
                </div>
            </div>
             <div id="left_biaoti" class="left_biaoti">
            	 
            </div>
            <div class="left_grb"><a href="${ctx}/web/Web/getNewsByTitle.do?title=grb"target="_blank"><img src="${ctx}/images/web/grb.jpg" /></a></div>
            <div class="left_grb"><a href="${ctx}/web/Web/getNewsByTitle.do?title=lgt"target="_blank"><img src="${ctx}/images/web/lgt2.jpg" /></a></div>
            <div class="left_nrbox" style="border:1px solid #d5d5d5;">
            	<div class="left_nrbox_title">安全宣传</div>
               <div class="safety_img">
                	<div class="lxfscroll" id="lxfscroll" >
                	   <ul>
                     
                      </ul>
                    
                    </div>
                </div>
            </div>
            <div class="left_nrbox" style="border:1px solid #d5d5d5;" >
            	<div class="left_nrbox_title">节能环保</div>
                <div class="safety_img">
                	<div class="wrapper">
                        <div id="focus">
	                        <ul>
                              
                            </ul> 
                        </div>
                    </div>
                </div>
			  </div>
            <div class="left_nrbox">
            	<div class="left_nrbox_title">友情链接</div>
            	
                <div class="safety_img link" style="heigth:70px" >
                    
                	<select id="s1" name="s1"  onchange="clearOption('s2','s3')">
                    	<option value="">请选择</option>
                    </select>
                    <select id="s2" name="s2"  onchange="clearOption('s1','s3')">
                    	<option  value="">请选择</option>
                    </select>
                    <select id="s3" name="s3"  onchange="clearOption('s2','s1')">
                    	<option  value="">请选择</option>
                    </select>
                    <input type="button" value="" onclick="openUrl()"  />
                </div>
            </div>
        </div>
        <div class="right">
        	<div class="right_topdiv">
            	<div class="right_topdiv_left" id="yaowen">
            	  	<ul> 
            	   </ul>
                </div>
                <div class="right_lunbo"style="margin-left:0px;line-height:30px;">
                	<div class="flash">
                        <div class="flash_top"  >
                           
                        </div>
                        <div class="flash_bottom"> 
                            <div class="flash_bottom_right" id="yaowenNum">
                                  <div id="list_0" class="jiaodian">1</div>
                                <div id="list_1">2</div>
                                <div id="list_2">3</div>
                            </div>
                        </div>
                        <div id="imglistbox" class="ul1"> 
                                    <div><a href="#"><img src="../images/lunbo.jpg"/></a></div>
                            <div><a href="#"><img src="../images/lunbo.jpg" /></a></div>
                            <div><a href="#"><img src="../images/lunbo.jpg"/></a></div>
                         </div>
            		</div>
                
                </div>

                <div class="clear"></div>
            </div>
            <div class="right_yunshubox">
            	<div class="right_yunshuboxL">
                	<div class="ys_title">
                    	<a href="${ctx}/news/list.jsp?xw=GetDuanFaFile" style="font-family:Times;font-size:14x" target="_blank"> more >></a>段发文件
                    </div>
                    <div  id="dfwj"></div>   
                   
                </div>
                <div class="right_yunshuboxL" style="margin-left:10px;">
                	<div class="ys_title">
                    	<a href="${ctx}/news/list.jsp?xw=GetBuMenFile" style="font-family:Times;font-size:14x" target="_blank"> more >></a>部门文件
                    </div>
                    <div  id="bmwj"></div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="right_yunshubox">
            	<div class="right_yunshuboxL">
                	<div class="ys_title">
                    	<a href="${ctx}/news/list.jsp?xw=GetCircsAviso" style="font-family:Times;font-size:14x" target="_blank">more >></a>情况通报
                    </div>
                    <div  id="qktb"></div>
                </div>
                <div class="right_yunshuboxL" style="margin-left:10px;">
                	<div class="ys_title">
                    	<a href="${ctx}/news/list.jsp?xw=GetHuiyiNotice" style="font-family:Times;font-size:14x" target="_blank"> more >></a>会议纪要
                    </div>
                    <div  id="hyjy"></div>
                </div>
                <div class="clear"></div>
            </div>
            <div id="title" class="right_xcimg" align="center" style="" ></div>
            <div id="newsContent">
           
            </div>
           
            <div class="right_topdiv" style="margin-top:15px;">
                <div  style="font-family:仿宋;color:#d5262a;font-weight:bold;background:url(${ctx}/images/web/1.jpg) no-repeat;width:700px;margin-top:2px;height:26px;line-height:26px;font-size:18px;padding-top:1px;padding-left:1px;">
                      <b> 	<a href="${ctx}web/Web/listVideos.do" style="display:inline-block;color:#d5262a;"target="_blank"   >视频专栏</a></b>
               </div>
                <div class="flashB">
                        <div class="flash_topB">
                         </div>
                        <div class="flash_bottomB">
        
                            <div class="flash_bottom_rightB" id="vedioNum">
                                
                            </div>
                        </div>
                        <div id="imglistboxB" class="ul2"  >
                        
                        </div>
            		</div>
            	<div class="right_topdiv_leftb"  id="vedioTitle">
                    <ul >
                        
                    </ul>
                </div>
                
                <div class="clear"></div>
            </div> 
              
        
                  
            <div class="right_ztbox" >
            	    <div  style="font-family:仿宋;color:#d5262a;font-weight:bold;background:url(${ctx}/images/web/1.jpg) no-repeat;width:700px;margin-top:2px;height:26px;line-height:26px;font-size:18px;padding-top:1px;padding-left:1px;">
                    	<b>专题栏目</b>
                </div> 
            	<div class="right_yunshuboxL">
                	 <ul>
                    	<li><a href="${ctx}/web/Web/getNewsByTitle.do?title=dj1" target="_blank">专题（一）</a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=dj2" target="_blank">专题（二）</a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=dj3" target="_blank">专题（三）</a></li> 
                    </ul>
                </div>
                <div class="right_yunshuboxL" style="margin-left:10px;">
                	 <ul>
                    	<li><a href="${ctx}/web/Web/getNewsByTitle.do?title=zg1" target="_blank">专题（四）</a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=zg2" target="_blank">专题（五）</a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=zg3" target="_blank">专题（六）</a></li> 
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
            
        </div>
        <div class="clear"></div>
    </div>
    <div id="winpop">
    <div class="title">
        <span id='title_con'>公告</span><span class="close" title="关闭" onclick="tips_pop()">
        <img src="${ctx}/images/web/winpopTispopTopClose.gif" width="12" height="11" /></span>
        
    </div>
 	  <div class="con" id='notice'></div> 
    </div>
  <div   style="background:url(${ctx}/images/web/sheying.jpg) no-repeat;color:#FFFFFF;font-weight:bold; height:33px; line-height:31px; font-size:14px; padding-left:22px;" >
                    	 <a href="${ctx}/news/photolist.jsp" style="display:inline-block;color:#FFFFFF;" target="_blank"   >摄影贴图</a>
                 </div>
  <div class="login_scroll">
    <div class="scroll_big" style="display:block;">
         <span id="prev2"><img  src="${ctx}/images/web/lunbo_L.jpg" /></span>
            <div id="box2" class="scroll_f">
                <ul>
          
            
                </ul>
            </div>
        <span id="next2" style="margin-left:-5px;"><img src="${ctx}/images/web/lunbo_R.jpg" /></span>
    </div>
    </div>
    <div class="footer"><ul>Copyright ©2011-2012 北京车辆段 版权所有</ul> <ul>       信息技术科 联系电话：010-51868237</ul>
</div>
</div>
</body>
</html>
<script>

function initData(){
     $.get('${ctx}/news/Menu/topList.do?t='+Math.random(), function(josn) {
         	 if(josn!=""){
		     josn = josn.replace(new RegExp("null","gm"),'""');
		     var mydata = eval("("+josn+")");
			     if(mydata.weather!=''){
			       var ojb=mydata.weather; 
			       var temp=ojb.names.replace(new RegExp("#","gm"),'<br>'); 
			       document.getElementById("weather").innerHTML='<img src="${ctx}'+ojb.urls+'" height="50px"/>'+'<div>'+temp+'</div>';
			        
			   }
			    if(mydata.title!=''){ 
			       var ojb=mydata.title;
			       document.getElementById("title").innerHTML='<b>'+ojb.names+'</b>';
			       
			   }
			    if(mydata.safe1!=''){
			       var ojb=mydata.safe1; 
			       document.getElementById("safe1").innerHTML=ojb.names;
			       if(ojb.createTimeString!=''){ 
			          var arr1 = ojb.createTimeString.split("-"); 
			           var dt1 = new Date(); 
						dt1.setFullYear(arr1[0]); 
						dt1.setMonth(arr1[1] - 1); 
						dt1.setDate(arr1[2]); 
						var dt2 = new Date(); 
						var dif = dt2.getTime() - dt1.getTime(); 
						var days = parseInt(dif / (24 * 60 * 60 * 1000))+''; 
						 
						var content='';
						for(var i=0;i<days.length;i++){
						
						   content+='<td>'+days.charAt(i)+'</td>';
						}
						if(days.length<4){
						   for(var i=0;i<4-days.length;i++){
						     content='<td>0</td>'+content;
						   }
						}
						content='<tr>'+content+'</tr>';
						$("#safe1Table").append(content);
			       }
			       
			         
			   }
			   if(mydata.safe2!=''){
			       var ojb=mydata.safe2; 
			       document.getElementById("safe2").innerHTML=ojb.names;
			       if(ojb.createTimeString!=''){
			         var arr1 = ojb.createTimeString.split("-"); 
			         var dt1 = new Date(); 
						dt1.setFullYear(arr1[0]); 
						dt1.setMonth(arr1[1] - 1); 
						dt1.setDate(arr1[2]); 
						var dt2 = new Date(); 
						var dif = dt2.getTime() - dt1.getTime(); 
						var days = parseInt(dif/(24 * 60 * 60 * 1000))+''; 
						 
						var content='';
						for(var i=0;i<days.length;i++){
						
						   content+='<td>'+days.charAt(i)+'</td>';
						}
						if(days.length<4){
						   for(var i=0;i<4-days.length;i++){
						     content='<td>0</td>'+content;
						   }
						}
						content='<tr>'+content+'</tr>';
						$("#safe2Table").append(content);
						
			       } 
			   }
			   if(mydata.safe3!=''){
			       var ojb=mydata.safe3; 
			       document.getElementById("safe3").innerHTML=ojb.names;
			       if(ojb.createTimeString!=''){
			          var arr1 = ojb.createTimeString.split("-"); 
			         var dt1 = new Date(); 
						dt1.setFullYear(arr1[0]); 
						dt1.setMonth(arr1[1] - 1); 
						dt1.setDate(arr1[2]); 
						var dt2 = new Date(); 
						var dif = dt2.getTime() - dt1.getTime(); 
						var days = parseInt(dif / (24 * 60 * 60 * 1000))+''; 
						 
						var content='';
						for(var i=0;i<days.length;i++){
						
						   content+='<td>'+days.charAt(i)+'</td>';
						}
						if(days.length<4){
						   for(var i=0;i<4-days.length;i++){
						     content='<td>0</td>'+content;
						   }
						}
						content='<tr>'+content+'</tr>';
						$("#safe3Table").append(content);
			       } 
			   }
			    if(mydata.menus!=''){
			      var ojb=mydata.menus;
			      var content='';
			      for(var i=0;i<ojb.length;i++){
			        if(ojb[i].urls==''){
			           ojb[i].urls='#';
			        } 
			        content+='<li>';
			        content+='<a href="'+ojb[i].urls+'">'+ojb[i].names+'</a>';
			        content+='<ul>';
					if(ojb[i].names=='办公中心' || ojb[i].names=='电子邮件'|| ojb[i].names=='文件传递'
									|| ojb[i].names=='软件下载'|| ojb[i].names=='干部考核')
					 {
						 content+='<li><a href="'+ojb[i].urls+'"target="_blank">'+ojb[i].names+'</a></li>';
					}
                    if(ojb[i].childrenMenu!=''){
                        var children=ojb[i].childrenMenu;
 						for(var j=0;j<children.length;j++){ 
							content+='<li><a href="'+children[j].urls+'"target="_blank">'+children[j].names+'</a></li>';
						 }
						
			         }
			         content+='</ul>';
			         content+='</li>';
			         
			      }
			     // alert(content);
			      document.getElementById("nav").innerHTML=content;
			      menuFix();
			   }
			    if(mydata.topTitle!=''){
			      var ojb=mydata.topTitle;
			      var content='<dl>';
			      for(var i=0;i<ojb.length;i++){
			        if(i>0&&i%2==0){
			            content+='</dl><dl>';
			        }		         
	                if('${sessionScope.username}'!= '') {    		
 				        content+='<dd><a href="'+ojb[i].urls+'"target="_blank">'+ojb[i].names+'</a> </dd>';					
				    }else{		 
				        if(ojb[i].names == '支出动态表' || ojb[i].names == '通讯录' || ojb[i].names == '值班表'){
				             content+='<dd><a href="javascript:alert(\'您没有登录或者您的账号没有访问权限！\');">'+ojb[i].names+'</a></dd>';
				       			
				        }else{       
					 		 content+='<dd><a href="'+ojb[i].urls+'"target="_blank">'+ojb[i].names+'</a> </dd>';	
					    }					
				    }
				  }
			      content+=' <div class="clear"></div>'; 
			      document.getElementById("logo_middle").innerHTML=content;
			      
			     
			   } 
			   if(mydata.leftTitle!=''){
			      var ojb=mydata.leftTitle;
			       var content=''; 
			      for(var i=0;i<ojb.length;i++){ 
					content+='<a href="'+ojb[i].urls+'"target="_blank"  >'+ojb[i].names+'</a>  ';
				  }
			      document.getElementById("left_biaoti").innerHTML=content;
			   }
			   
			   if(mydata.friendLink!=''){
			       var ojb=mydata.friendLink; 
			       var len=0;
                   for(var i=0;i<ojb.length;i++){  
				      document.getElementById("s1").options.add(new Option(ojb[i].names,ojb[i].urls));
			      }  //end ojb
			    //这是调用代码
				  
			   }  //end leftTitle
			   
			    if(mydata.friendLink1!=''){
			       var ojb=mydata.friendLink1; 
			       var len=0;
                   for(var i=0;i<ojb.length;i++){  
				      document.getElementById("s2").options.add(new Option(ojb[i].names,ojb[i].urls));
			      }  //end ojb
			    //这是调用代码
				  
			   }  //end leftTitle
			   
			    if(mydata.friendLink2!=''){
			       var ojb=mydata.friendLink2; 
			       var len=0;
                   for(var i=0;i<ojb.length;i++){  
				      document.getElementById("s3").options.add(new Option(ojb[i].names,ojb[i].urls));
			      }  //end ojb
			    //这是调用代码
				  
			   }  //end leftTitle
			    
			}
			  
        }) ;  
       
   }
   function initNews(){
       $.get('${ctx}/news/News/getNewsByTitleAjax.do?title=top&pNum=6&t='+Math.random(), function(josn) {
          josn = josn.replace(new RegExp("null","gm"),'""');
          var mydata = eval("("+josn+")"); 
          var content="";
          var numb=0;
          for(var p in mydata){  
             
	         var cat=mydata[p]; 
	         
	         if(p>0){
	             if(numb%2==0){
		             content+='<div class="right_yunshubox">';
		              content+='<div class="right_yunshuboxL">';
		         }else{
		             content+='<div class="right_yunshuboxL"  style="margin-left:10px;">';
		         }
		        
	             content+='<div class="right_huiyititle">';
	             content+='<a href="${ctx}/web/Web/listNews.do?categoryid='+cat.id+'"target="_blank"><img src="${ctx}/images/web/more.jpg" /></a>'+cat.names;
	             content+='</div>';
	             content+='<ul>';
	             var ojbs=cat.newsList;
				 for(var i=0;i<ojbs.length;i++){
				    var temp=ojbs[i];
				    if(i>=5){
	             	  break;
	             	}
	             	content+='<li>';
					content+='<span>';
					content+=temp.createTimeString;
					content+='</span>';
					content+='<a href="${ctx}/web/Web/showNews.do?newsid='+temp.id+'" target="_blank">'+temp.title.substring(0,17)+(temp.title.length>17?'...':"")+'</a>';
	             	
	             }   
				 content+='</li>';
	             content+='</ul>';
	             content+='</div>';
	             if(numb%2==1){
		             content+='<div class="clear"></div></div>';
		         }
		         numb=numb+1;
		      }else{   // 首栏新闻 
		         var ojbs=cat.newsList;
		         var yaowen='<div   style="font-family:仿宋 ;color:#d5262a;font-weight:bold;background:url(${ctx}/images/web/1.jpg) no-repeat; height:36px; line-height:26px; font-size:18px;padding-top:1px;padding-left:1px;"  ><a href="${ctx}/web/Web/listNews.do?categoryid='+cat.id+'" style="display:inline-block;color:#d5262a;"target="_blank"   >图片专栏</a></div><ul>';
		         var yaowenNum=''; 
		         var imglistbox=''; 
				 for(var i=0;i<ojbs.length;i++){
				    var temp=ojbs[i];
					yaowen+='<div class=yaowenNum_yunshuboxL>';
					yaowen+='<ul>';
	                yaowen+='<li>';
					yaowen+='<span>';
					yaowen+=temp.createTimeString;
					yaowen+='</span>';
					yaowen+='<a href="${ctx}/web/Web/showNews.do?newsid='+temp.id+'" target="_blank">'+temp.title.substring(0,17)+(temp.title.length>17?'...':"")+'</a></li>';
	                var tempNum=i+1;
                    if(i==0){
                       
	                	yaowenNum+='<div id="list_'+i+'" class="jiaodian">'+tempNum+'</div>';
	                }else{
	                  	yaowenNum+='<div id="list_'+i+'" >'+tempNum+'</div>';
	                }
	                imglistbox+='<div><a href="${ctx}/web/Web/showNews.do?newsid='+temp.id+'"target="_blank"><img src="${ctx}'+temp.fromUrl+'"/></a></div>';
	             } 
	             yaowen+='</ul>';
				 yaowen+='</div>';
		      }
           }
           document.getElementById("newsContent").innerHTML=content;
           document.getElementById("yaowen").innerHTML=yaowen;
           document.getElementById("yaowenNum").innerHTML=yaowenNum;
           document.getElementById("imglistbox").innerHTML=imglistbox;
           
        $(".flash_top").empty();
        $(".ul1").find("div").eq(0).find("a").clone().appendTo(".flash_top");
        $(".flash_top img").attr({id:"play",
                                 width:$(".flash_top").css("width").replace("px",""),
                                 height:$(".flash_top").css("height").replace("px","")});
        $(".flash_bottom_right").find("div").each(function (i) {
            $(this).click(function () {
                $(".flash_bottom_right").find("div").each(function(i){
                    $(".flash_bottom_right").find("div").eq(index).removeClass("jiaodian");
                });
                $(this).addClass("jiaodian");
                $("#play").hide().attr({src:$(".ul1").find("img").eq(i).attr("src"),
                                        alt:$(this).find("img").eq(i).attr("alt")});
                $(".flash_top").find("a").eq(0).attr({href:$(".ul1").find("div").eq(i).find("a").eq(0).attr("href")});
                $("#play").fadeIn(img_VanishTime);
                index=i;
                
            });
        });
         window.setInterval(play,showTime);
           
       });
   }
   function initXW(){ //初始化行文
      
         //未签收文件
        $.ajax({
            url:'${ctx}/web/Web/getXW.do?t='+Math.random(),
            type: "Get",  
            data:'xwurls=http://10.78.109.30:8099/GetJosn.asmx/GetWeiQianShou',
            success:function (result) {
              var mydata = eval("("+result+")");  
              var content="<ul>";
              for(var p in mydata){ 
                 content+='<li style="background:url(${ctx}/images/web/left_dot.jpg) no-repeat left center;margin-bottom:10px;margin-left:14px;"><a style="font-size:12px; color:#8a2220;" href="http://10.78.109.30:8099/" target="_blank">'+mydata[p].DeptName+'('+mydata[p].Count+')'+'</a></li>';
		      }
		      content+="</ul>";              
		   	  document.getElementById("newsList").innerHTML=content;
            },
            error: function (e) {
             //  alert(e.responseText); 
            }
        });
        //段发文件
        $.ajax({
           url:'${ctx}/web/Web/getXW.do?t='+Math.random(),
            type: "Get",  
            data:'xwurls=http://10.78.109.30:8099/GetJosn.asmx/GetDuanFaFile',
            success:function (result) {
              var mydata = eval("("+result+")");  
              var content="<ul>";
              for(var p in mydata){ 
              content+='<li class=xwsub>'
				 content+='<span>'
				 content+=mydata[p].DateTime;
				 content+='</span>'
				if('${sessionScope.username}'!= '') {  
				     content+='<a href="http://10.78.109.30:8099/duandispatch/opendocument.aspx?filename='+mydata[p].FilePath+'" target="_blank">'+mydata[p].Title+'</a></li>'; 
        		}else{	
				     content+='<a href="http://10.78.109.30:8099/" target="_blank">'+mydata[p].Title+'</a></li>';
				 }
               }
		      content+="</ul>";              
		   	  document.getElementById("dfwj").innerHTML=content;
            },
            error: function (e) {
             //  alert(e.responseText); 
            }
        });
        //会议纪要
        $.ajax({
           url:'${ctx}/web/Web/getXW.do?t='+Math.random(),
            type: "Get",  
            data:'xwurls=http://10.78.109.30:8099/GetJosn.asmx/GetHuiyiNotice',
            success:function (result) {
              var mydata = eval("("+result+")");  
              var content="<ul>";
              for(var p in mydata){ 
                  content+='<li class=xwsub>'
				 content+='<span>'
				 content+=mydata[p].DateTime;
				 content+='</span>'
				if('${sessionScope.username}'!= '') {  
				     content+='<a href="http://10.78.109.30:8099/duandispatch/opendocument.aspx?filename='+mydata[p].FilePath+'" target="_blank">'+mydata[p].Title+'</a></li>'; 
        		}else{	
				     content+='<a href="http://10.78.109.30:8099/" target="_blank">'+mydata[p].Title+'</a></li>';
				  }
              }
		      content+="</ul>";              
		   	  document.getElementById("hyjy").innerHTML=content;
            },
            error: function (e) {
              // alert(e.responseText); 
            }
        });
        //情况通报
        $.ajax({
            url:'${ctx}/web/Web/getXW.do?t='+Math.random(),
            type: "Get",  
            data:'xwurls=http://10.78.109.30:8099/GetJosn.asmx/GetCircsAviso',
            success:function (result) {
              var mydata = eval("("+result+")");  
              var content="<ul>";
              for(var p in mydata){ 
                 content+='<li class=xwsub>'
				 content+='<span>'
				 content+=mydata[p].DateTime;
				 content+='</span>'
				if('${sessionScope.username}'!= '') {  
				     content+='<a href="http://10.78.109.30:8099/duandispatch/opendocument.aspx?filename='+mydata[p].FilePath+'" target="_blank">'+mydata[p].Title+'</a></li>'; 
        		}else{	
				     content+='<a href="http://10.78.109.30:8099/" target="_blank">'+mydata[p].Title+'</a></li>';
				 }
               }
		      content+="</ul>";              
		   	  document.getElementById("qktb").innerHTML=content;
            },
            error: function (e) {
               //alert(e.responseText); 
            }
        });
        //部门文件
        $.ajax({
           url:'${ctx}/web/Web/getXW.do?t='+Math.random(),
            type: "Get",  
            data:'xwurls=http://10.78.109.30:8099/GetJosn.asmx/GetBuMenFile',
            success:function (result) {
              var mydata = eval("("+result+")");  
              var content="<ul>";
              for(var p in mydata){ 
               content+='<li class=xwsub>'
				 content+='<span>'
				 content+=mydata[p].DateTime;
				 content+='</span>'
				 if('${sessionScope.username}'!= '') {  
				     content+='<a href="http://10.78.109.30:8099/duandispatch/opendocument.aspx?filename='+mydata[p].FilePath+'" target="_blank">'+mydata[p].Title+'</a></li>'; 
        		}else{	
				     content+='<a href="http://10.78.109.30:8099/" target="_blank">'+mydata[p].Title+'</a></li>';
				  }
              }
		      content+="</ul>";              
		   	  document.getElementById("bmwj").innerHTML=content;
            },
            error: function (e) {
              // alert(e.responseText); 
            }
        });
       
   }
  function initSafHb(){ //初始化左侧漫画
       $.get('${ctx}/news/News/getNewsByTitleAjax.do?title=safe&pNum=7&t='+Math.random(), function(josn) {
           var content="<ul>";
          if(josn!=""){
	          josn = josn.replace(new RegExp("null","gm"),'""');
	          var mydata = eval("("+josn+")"); 
	          for(var p in mydata){  
	             var cat=mydata[p];  
	             
		         if(cat.caTypes=='IMG'){
		      
			          var ojbs=cat.newsList;
					  for(var i=0;i<ojbs.length;i++){
					  	  var temp=ojbs[i];
						  if(i>=5){
				             	  break;
				           }
							//<img src="${ctx}'+temp.fromUrl+'"  width="200" height="200" />
				        content+=' <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=safe" target="_blank"><img src="${ctx}'+temp.fromUrl+'" width="170" height="200" /></a></li>';
              		   }   	
			       }     
		       }
	        }
	        content+='</ul>';
	          
           document.getElementById("lxfscroll").innerHTML=content;
           
           //滚动
		    var ul = $(".lxfscroll ul");
			var li = $(".lxfscroll li");
			var tli = $(".lxfscroll-title li");	
			var len = $("#lxfscroll ul li").length; //获取焦点图个数
			var speed = 350;
			var autospeed = 3000;	
			var i=1;
			var index = 0;
			var n = 0;
		    /* 标题按钮事件 */
			function lxfscroll() {
						var index = tli.index($(this));					
						tli.removeClass("cur");
						$(this).addClass("cur");
						
						ul.css({"left":"0px"});	
						li.css({"left":"0px"}); 
						li.eq(index).css({"z-index":i});	
						li.eq(index).css({"left":"200px"});	
						ul.animate({left:"-200px"},speed); 	
						i++;	
					
		    };
			/* 自动轮换 */
			function autoroll() {
					if(n >=len) {
						n = 0;
					}
					tli.removeClass("cur");
				    tli.eq(n).addClass("cur");
					ul.css({"left":"0px"});	
				    li.css({"left":"0px"}); 
				    li.eq(n).css({"z-index":i});	
				    li.eq(n).css({"left":"200px"});	
				 	
					n++;
					i++;
					timer = setTimeout(autoroll, autospeed);
					ul.animate({left:"-200px"},speed);
				};
			/* 鼠标悬停即停止自动轮换 */
			 function stoproll() {
							li.hover(function() {
								clearTimeout(timer);
								n = $(this).prevAll().length+1;
							}, function() {
								timer = setTimeout(autoroll, autospeed);
							});
							tli.hover(function() {
								clearTimeout(timer);
								n = $(this).prevAll().length+1;
							}, function() {
								timer = setTimeout(autoroll, autospeed);
							});
			 };			
			tli.mouseenter(lxfscroll);
			autoroll();
			stoproll();  
			 
        });       
   		$.get('${ctx}/news/News/getNewsByTitleAjax.do?title=hb&pNum=7&t='+Math.random(), function(josn) {
   		    var content="<ul>";
          if(josn!=""){
	          josn = josn.replace(new RegExp("null","gm"),'""');
	          var mydata = eval("("+josn+")"); 
	          for(var p in mydata){  
	             var cat=mydata[p];  
		         if(cat.caTypes=='IMG'){
			          var ojbs=cat.newsList;
					  for(var i=0;i<ojbs.length;i++){
					  	  var temp=ojbs[i];
						  if(i>=5){
				             	  break;
				           }
				           content+='<li>';
                           content+='<div style="left:0; top:0; width:200px; height:200px;"><a href="${ctx}/web/Web/getNewsByTitle.do?title=hb"target="_blank" ><img src="${ctx}'+temp.fromUrl+'" width="170" height="200" /></a></div>';                
                           content+='</li>';
				       }   	 
		          }     
		       }
	        }
	        content+='</ul>'; 
           document.getElementById("focus").innerHTML=content;
           
           var sWidth = $("#focus").width(); //获取焦点图的宽度（显示面积）
			var len = $("#focus ul li").length; //获取焦点图个数
			var index = 0;
			var picTimer;
			
			//以下代码添加数字按钮和按钮后的半透明长条
			var btn = "<div class='btnBg'></div><div class='btn'>";
			for(var i=0; i < len; i++) {
				btn += "<span></span>";
			}
			btn += "</div>" 
			$("#focus").append(btn);
			$("#focus .btnBg").css("opacity",0.5); 
			//本例为左右滚动，即所有li元素都是在同一排向左浮动，所以这里需要计算出外围ul元素的宽度
			$("#focus ul").css("width",sWidth * (len + 1));
			
			//鼠标滑入某li中的某div里，调整其同辈div元素的透明度，由于li的背景为黑色，所以会有变暗的效果 
			//鼠标滑上焦点图时停止自动播放，滑出时开始自动播放
			$("#focus").hover(function() {
				clearInterval(picTimer);
			},function() {
				picTimer = setInterval(function() {
					if(index == len) { //如果索引值等于li元素个数，说明最后一张图播放完毕，接下来要显示第一张图，即调用showFirPic()，然后将索引值清零
						showFirPic();
						index = 0;
					} else { //如果索引值不等于li元素个数，按普通状态切换，调用showPics()
						showPics(index);
					}
					index++;
				},3000); //此3000代表自动播放的间隔，单位：毫秒
			}).trigger("mouseleave");
			
			//显示图片函数，根据接收的index值显示相应的内容
			function showPics(index) { //普通切换
				var nowLeft = -index*sWidth; //根据index值计算ul元素的left值
				$("#focus ul").stop(true,false).animate({"left":nowLeft},500); //通过animate()调整ul元素滚动到计算出的position
				$("#focus .btn span").removeClass("on").eq(index).addClass("on"); //为当前的按钮切换到选中的效果
			}
			
			function showFirPic() { //最后一张图自动切换到第一张图时专用
				$("#focus ul").append($("#focus ul li:first").clone());
				var nowLeft = -len*sWidth; //通过li元素个数计算ul元素的left值，也就是最后一个li元素的右边
				$("#focus ul").stop(true,false).animate({"left":nowLeft},500,function() {
					//通过callback，在动画结束后把ul元素重新定位到起点，然后删除最后一个复制过去的元素
					$("#focus ul").css("left","0");
					$("#focus ul li:last").remove();
				}); 
				$("#focus .btn span").removeClass("on").eq(0).addClass("on"); //为第一个按钮添加选中的效果
			}
		        }); 
		   }
		   function initPhoto(){ 
		      $.get('${ctx}/files/Files/listAjax.do?fileTypes=PHOTO&t='+Math.random(), function(josn) {
		          var content="<ul>";
		          if(josn!=""){
		            var mydata = eval("("+josn+")");
		            var ojbs=mydata.rows; 
		              if(mydata.rows!=undefined){       
						 for(var i=0;i<ojbs.length;i++){ 		
						   var temp=ojbs[i];
						   
						    var t =temp.ctxpaths;
						   
						    var t1 = t.lastIndexOf('.');		      
			      			var t2 = t.substring(0,t1);
			      			var t3 = t.substring(t1);
			 
			               content+='<li><a href="'+temp.ctxpaths+'"target="_blank"><img src="${ctx}'+t2+'_s'+t3+'"  width="146" height="111"/><span>'+temp.names+'</span></a></li>';
			             
			             }
		             }
		          }
		          if(content=="<ul>") {
		             
		             content+="<li></li>";
		          }
		          content+="</ul>";
		          
		         document.getElementById("box2").innerHTML=content; 
		          if(ojbs!=undefined&&ojbs.length>4){
			         //图片滚动
			        $("#box2").jCarouselLite({
			                btnPrev: "#prev2",
			                btnNext: "#next2",
			                auto: 3000, //图片停留时间
			                scroll: 1, //每次滚动覆盖的图片个数
			                speed: 200, //设置速度，0是不动。其次就是数字越大 ，移动越慢。
			                vertical: false, //横向（true），竖向（false）
			                visible:5, //显示的数量
			                circular: true //是否循环
			         });
		         }
		         //滚动结束
     }) ;  
       
   }
   function initNotice(){
       $.get('${ctx}/web/Web/getLatestNotice.do?t='+Math.random(), function(josn) {
    
           if(josn!=""){
               josn = josn.replace(new RegExp("null","gm"),'""');
               var mydata = eval("("+josn+")");
               var ojbs=mydata.rows;
               content="";
               for(var i=0;i<ojbs.length;i++){
                   content+='<br><a style="color:#6C6C6C;display:inline-block;" href="${ctx}/news/notice.jsp?id='+ojbs[i].id+'&title='+ojbs[i].title+'&content='+ojbs[i].content+'"target="_blank" >'+ojbs[i].title+'</a><br>';    
                }
				if(ojbs.length==0){
					return false;
				}

                document.getElementById('winpop').style.height = '0px';
				var _hours = (new Date()).getHours();
				var _minutes = (new Date()).getMinutes();
			    
				document.getElementById('notice').innerHTML = content;
				tips_pop();
           }
       }) ; 
   }
    function initVedio(){
      $.get('${ctx}/files/Files/listAjax.do?fileTypes=VIDEO&t='+Math.random(), function(josn) {
          var content='';
          var vedioNum='';
          var vedioTitle=' <ul  >';
		  var displaylength = 6;
          if(josn!=""){
          josn = josn.replace(new RegExp("null","gm"),'""');
           var mydata = eval("("+josn+")");
           
           var ojbs=mydata.rows;
           if(mydata.rows!=undefined){
			   if(ojbs.length < displaylength ){
					displaylength  = ojbs.length;
				}
				for(var i=0;i< displaylength ;i++){

			       content+='<div><a href="${ctx}/web/Web/showVedio.do?fileid='+ojbs[i].id+'"  target="_blank"><img src="${ctx}'+ojbs[i].fileImg+'"/></a></div>';
	               vedioNum+='<div id="list_'+i+'"   >'+(i+1)+'</div>';   
	               vedioTitle+='<li ><span>'+ojbs[i].createTimeString+'</span><a href="${ctx}/web/Web/showVedio.do?fileid='+ojbs[i].id+'" target="_blank">'+ojbs[i].names.substring(0,17)+(ojbs[i].names.length>17?'...':"")+'</a></li>';          
	            
            	}
            }
          }
          vedioTitle+='</ul>';
          document.getElementById("imglistboxB").innerHTML=content;
          document.getElementById("vedioNum").innerHTML=vedioNum;
          document.getElementById("vedioTitle").innerHTML=vedioTitle;
           
           $(".flash_topB").empty();
	        $(".ul2").find("div").eq(0).find("a").clone().appendTo(".flash_topB");
	        $(".flash_topB img").attr({id:"playB",width:$(".flash_topB").css("width").replace("px",""),height:$(".flash_topB").css("height").replace("px","")});
	        $(".flash_bottom_rightB").find("div").each(function (i) {
	            $(this).click(function () {
	                $(".flash_bottom_rightB").find("div").each(function(i){
	                    $(".flash_bottom_rightB").find("div").eq(index).removeClass("jiaodianB");
	                });
	                $(this).addClass("jiaodianB");
	                $("#playB").hide().attr({src:$(".ul2").find("img").eq(i).attr("src"),
	                                        alt:$(this).find("img").eq(i).attr("alt")});
	                $(".flash_topB").find("a").eq(0).attr({href:$(".ul2").find("div").eq(i).find("a").eq(0).attr("href")});
	                $("#playB").fadeIn(img_VanishTimeB);
	                indexB=i;
	                
	             
	            });
	        });
	         window.setInterval(playB,showTimeB); 
     }) ;    
   }
    
</script>


